﻿using System.Collections.Generic;
using System;

namespace HurricanePackage
{
    /// <summary>
    /// 消息系统的无参委托缓存池
    /// </summary>
    public class BroadcastActionCache : ObjectCache<BroadcastAction, List<Action>>
    {
        public BroadcastActionCache() : base(1, 20)
        {
            Init(new List<Action>());
        }
        protected override void _OnCacheInit(List<Action> _template)
        {

        }

        protected override string WarningTxt => "BroadcastActionCache";


        protected override BroadcastAction _CreateItem(List<Action> _template)
        {
            return new BroadcastAction(_template);
        }

        protected override void _DiscardItem(BroadcastAction _item)
        {
           _item?.Discard();
        }

        protected override void _ResetItem(BroadcastAction _item)
        {
            _item?.Reset();
        }
    }
}

